package com.lzw.d25bingso.task;

import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.widget.ImageView;

import com.lzw.d25bingso.tools.HttpUtils;

/**
 * Created by lzw on 2017/5/17.
 */

public class ImageDownLoad extends AsyncTask<String,Void,Bitmap>{
    private ImageView imageView;
    public ImageDownLoad(ImageView imageView) {
        this.imageView = imageView;
    }

    @Override
    protected Bitmap doInBackground(String... params) {
        return HttpUtils.getBitmapResult(params[0]);
    }

    @Override
    protected void onPostExecute(Bitmap bitmap) {
        super.onPostExecute(bitmap);
        imageView.setImageBitmap(bitmap);
    }
}
